/**
 * 
 */
package com.gxa.hualian.dao.impl;

import com.gxa.hualian.dao.UserDao;
import com.gxa.hualian.entity.User;
import org.apache.poi.ss.formula.functions.T;

import java.util.List;

/**
 * 利用反射技术,继承BaseDao,简化代码
 * @author bilei
 * @date 2022年4月15日 
 */
public class UserDaoImpl extends BaseDaoImpl<User>  implements UserDao {
	
	@Override
	public User selectById(Integer id) throws Exception {
		User user = super.selectById(id, User.class);
		return user;
	}

	@Override
	public Boolean deleteById(Integer id) throws Exception {
		Boolean aBoolean = super.deleteByName("id", id, User.class);
		return aBoolean;
	}

	@Override
	public Integer insert(User user) throws Exception {
		Integer lines = super.insert(user);
		return lines;
	}

	@Override
	public List<User> selectByQuery(String queryString, Class<User> clazz, Object... args) {
		return null;
	}

	@Override
	public List<User> selectAll() throws Exception {
		List<User> users = super.selectAll(User.class);
		return users;
	}

	@Override
	public List<User> selectByPhone(String phone) throws Exception {
		List<User> users = super.selectByName("phone", phone, User.class);
		return users;
	}



	@Override
	public Integer update(User user) throws Exception {
		Integer update = super.update("id",user.getId(), user);
		return update;

	}

	@Override
	public List<User> selectByPage(Integer page, Integer limit) throws Exception{
		return super.selectByPage(page,limit,User.class);

	}

	@Override
	public List<User> selectLikeName(Object value) throws Exception {
		 return  super.selectLikeName(value, User.class);

	}


}
